package org.bwgl.demo1.conf;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket configSwagger(){
        return new Docket(DocumentationType.OAS_30) // 文档的网页风格
                .apiInfo(apiinfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("org.bwgl.demo1.controller"))
                .paths(PathSelectors.any())
                .build();
    }

    private ApiInfo apiinfo() {
        return new ApiInfoBuilder().title("xxx项目测试文档")
                .description("南宁理工学院版权所有")
                .build();
    }
}
